<extend name="template/base_index" />

<block name="area_header">
	<link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/select2.min.css" />
	<link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/cosmo-skin.css" />

</block>

<block name="area_body">
	{:W('Menus/topbar')}
	<div class="admin-main container-fluid">
		{:W('Menus/left')}
		<div class="admin-main-content">
			{:W('Menus/breadcrumb')}
			<!-- 带验证 form -->
			<form class="form-horizontal well validateForm">
				<fieldset>
					<legend>
						菜单添加表单</legend>
					
					<div class="form-group">
						<label for="inputpid" class="col-md-2 col-lg-2 control-label">所属上级菜单</label>
						<div class="col-md-10 col-lg-10">
							<select name="pid" class="form-control input-normal select2">
								<option value="0">无</option>
								<volist name="mainmenus" id="vo">
									<option value="{$vo.id}">{$vo.name}</option>
								</volist>
							</select>
						</div>
					</div>
						
						
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">菜单名称</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" name="name" id="inputname" placeholder="请输入菜单名称">
							<div class="help-block">(菜单名称)</div>
						</div>
					</div>
					<!--<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">菜单类型</label>
						<div class="col-md-10 col-lg-10">
							<select name="type">
								<option value="view">跳转URL</option>
								<option value="url">点击推事件</option>
								<option value="scancode_push">扫码推事件</option>
								<option value="scancode_push">扫码推事件</option>
								<option value="scancode_waitmsg">扫码推事件且弹出“消息接收中”提示框</option>
								<option value="pic_sysphoto">弹出系统拍照发图</option>
								<option value="pic_photo_or_album">弹出系统拍照发图</option>
							</select>							
						</div>
					</div>-->
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">key</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" name="key" id="inputname" placeholder="请输入关联关键词">
							<div class="help-block">(关联关键词)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">外链URL</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control" name="url" id="inputname" placeholder="请输入外链URL">
							<div class="help-block">(外链URL)</div>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">排序</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" name="sort" value="1" id="inputname" placeholder="1">
							<div class="help-block">(排序,从大到小)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
						<div class="col-lg-10 col-md-10">
							<a target-form="validateForm" class="ajax-post btn btn-primary" href="{:U('Admin/'.CONTROLLER_NAME.'/add')}" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
							<a class="btn btn-default" href="{:U('Admin/'.CONTROLLER_NAME.'/index')}"><i class="fa fa-times-circle"></i> {:L('BTN_CANCEL')}</a>
						</div>
					</div>
				</fieldset>
			</form>
			<!-- form -->
		</div>
		<!-- END admin-main-content -->
	</div>
	<!-- END admin-main-->
</block>

<block name="area_footer">
	
	<script src="__CDN__/select2/4.0.0/js/select2.min.js"></script>
	<script src="__CDN__/select2/4.0.0/js/i18n/zh-CN.js"></script>
	<!--<script src="__CDN__/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js"></script>-->
	<script>
		$(function() {
			
			$(".select2").select2({
				language:"zh-CN"
			});
			
		});
	</script>
</block>